﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IconSpriteManager : MonoBehaviour
{
    public static IconSpriteManager _instance;

[Header("头像图标")]
    public Sprite[] HeadIcons;
    [Header("技能图标")]
    public Sprite[] SkillIcons;
    private Dictionary<ushort,Sprite> SkillIconDic = new Dictionary<ushort, Sprite>();

    void Awake()
    {
        _instance = this;
        for (int i = 0; i < SkillIcons.Length; i++)
        {
            SkillIconDic.Add(ushort.Parse(SkillIcons[i].name),SkillIcons[i]);
        }
    }

    /// <summary>
    /// 获取头像图标
    /// </summary>
    /// <param name="index"></param>
    /// <returns></returns>
    public Sprite GetHeadIconFromIndex(int index)
    {
        return HeadIcons[index];
    }

    /// <summary>
    /// 获取技能图标
    /// </summary>
    /// <param name="index"></param>
    /// <returns></returns>
    public Sprite GetSkillIconFromIndex(ushort index)
    {
        return SkillIconDic[index];
    }
}
